// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

package api

import (
	"strconv"
	"testing"

	"github.com/Azure/aks-engine/pkg/api/common"
	. "github.com/onsi/gomega"
)

func TestGetK8sVersionComponents(t *testing.T) {
	g := NewGomegaWithT(t)

	kubernetesImageBaseType := common.KubernetesImageBaseTypeGCR
	oneDotEighteenDotZero := getK8sVersionComponents("1.18.0", kubernetesImageBaseType, nil)
	if oneDotEighteenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent := kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.18"]
	expected := map[string]string{
		common.SchedulerComponentName:                     "kube-scheduler:v1.18.0",
		common.ControllerManagerComponentName:             "kube-controller-manager:v1.18.0",
		common.APIServerComponentName:                     "kube-apiserver:v1.18.0",
		common.KubeProxyAddonName:                         "kube-proxy:v1.18.0",
		common.CloudControllerManagerComponentName:        azureCloudControllerManagerImageReference,
		common.CloudNodeManagerAddonName:                  azureCloudNodeManagerImageReference,
		common.WindowsArtifactComponentName:               "v1.18.0/windowszip/v1.18.0-1int.zip",
		common.WindowsArtifactAzureStackComponentName:     "v1.18.0-azs/windowszip/v1.18.0-azs-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.DashboardMetricsScraperContainerName:       dashboardMetricsScraperImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.CoreDNSAddonName:                           getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
		common.CoreDNSAutoscalerName:                      clusterProportionalAutoscalerImageReference,
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
		common.AzureArcOnboardingAddonName:                azureArcOnboardingImageReference,
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.DNSSidecarComponentName:                    getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.CSIProvisionerContainerName:                csiProvisionerImageReference,
		common.CSIAttacherContainerName:                   csiAttacherImageReference,
		common.CSILivenessProbeContainerName:              csiLivenessProbeImageReference,
		common.CSILivenessProbeWindowsContainerName:       csiLivenessProbeWindowsImageReference,
		common.CSINodeDriverRegistrarContainerName:        csiNodeDriverRegistrarImageReference,
		common.CSINodeDriverRegistrarWindowsContainerName: csiNodeDriverRegistrarWindowsImageReference,
		common.CSISnapshotterContainerName:                csiSnapshotterImageReference,
		common.CSISnapshotControllerContainerName:         csiSnapshotControllerImageReference,
		common.CSIResizerContainerName:                    csiResizerImageReference,
		common.CSIAzureDiskContainerName:                  csiAzureDiskImageReference,
		common.CSIAzureFileContainerName:                  csiAzureFileImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.CSISecretsStoreProviderAzureContainerName:  csiSecretsStoreProviderAzureImageReference,
		common.CSISecretsStoreDriverContainerName:         csiSecretsStoreDriverImageReference,
		common.AzureKMSProviderComponentName:              azureKMSProviderImageReference,
	}
	g.Expect(oneDotEighteenDotZero).To(Equal(expected))

	oneDotSeventeenDotZero := getK8sVersionComponents("1.17.0", kubernetesImageBaseType, nil)
	if oneDotSeventeenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.17"]
	expected = map[string]string{
		common.SchedulerComponentName:                     "kube-scheduler:v1.17.0",
		common.ControllerManagerComponentName:             "kube-controller-manager:v1.17.0",
		common.APIServerComponentName:                     "kube-apiserver:v1.17.0",
		common.KubeProxyAddonName:                         "kube-proxy:v1.17.0",
		common.CloudControllerManagerComponentName:        azureCloudControllerManagerImageReference,
		common.CloudNodeManagerAddonName:                  azureCloudNodeManagerImageReference,
		common.WindowsArtifactComponentName:               "v1.17.0/windowszip/v1.17.0-1int.zip",
		common.WindowsArtifactAzureStackComponentName:     "v1.17.0-azs/windowszip/v1.17.0-azs-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.DashboardMetricsScraperContainerName:       dashboardMetricsScraperImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.CoreDNSAddonName:                           getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
		common.CoreDNSAutoscalerName:                      clusterProportionalAutoscalerImageReference,
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
		common.AzureArcOnboardingAddonName:                azureArcOnboardingImageReference,
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.DNSSidecarComponentName:                    getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.CSIProvisionerContainerName:                csiProvisionerImageReference,
		common.CSIAttacherContainerName:                   csiAttacherImageReference,
		common.CSILivenessProbeContainerName:              csiLivenessProbeImageReference,
		common.CSINodeDriverRegistrarContainerName:        csiNodeDriverRegistrarImageReference,
		common.CSISnapshotterContainerName:                csiSnapshotterImageReference,
		common.CSISnapshotControllerContainerName:         csiSnapshotControllerImageReference,
		common.CSIResizerContainerName:                    csiResizerImageReference,
		common.CSIAzureDiskContainerName:                  csiAzureDiskImageReference,
		common.CSIAzureFileContainerName:                  csiAzureFileImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.CSISecretsStoreProviderAzureContainerName:  csiSecretsStoreProviderAzureImageReference,
		common.CSISecretsStoreDriverContainerName:         csiSecretsStoreDriverImageReference,
		common.AzureKMSProviderComponentName:              azureKMSProviderImageReference,
	}
	g.Expect(oneDotSeventeenDotZero).To(Equal(expected))

	oneDotSixteenDotZero := getK8sVersionComponents("1.16.0", kubernetesImageBaseType, nil)
	if oneDotSixteenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.16"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.16.0",
		common.KubeProxyAddonName:                         getDefaultImage(common.KubeProxyAddonName, kubernetesImageBaseType) + ":v1.16.0",
		common.CloudControllerManagerComponentName:        azureCloudControllerManagerImageReference,
		common.CloudNodeManagerAddonName:                  azureCloudNodeManagerImageReference,
		common.WindowsArtifactComponentName:               "v1.16.0/windowszip/v1.16.0-1int.zip",
		common.WindowsArtifactAzureStackComponentName:     "v1.16.0-azs/windowszip/v1.16.0-azs-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.DashboardMetricsScraperContainerName:       dashboardMetricsScraperImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.CoreDNSAddonName:                           getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
		common.CoreDNSAutoscalerName:                      clusterProportionalAutoscalerImageReference,
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
		common.AzureArcOnboardingAddonName:                azureArcOnboardingImageReference,
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.DNSSidecarComponentName:                    getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CSIProvisionerContainerName:                csiProvisionerImageReference,
		common.CSIAttacherContainerName:                   csiAttacherImageReference,
		common.CSILivenessProbeContainerName:              csiLivenessProbeImageReference,
		common.CSINodeDriverRegistrarContainerName:        csiNodeDriverRegistrarImageReference,
		common.CSIResizerContainerName:                    csiResizerImageReference,
		common.CSIAzureDiskContainerName:                  csiAzureDiskImageReference,
		common.CSIAzureFileContainerName:                  csiAzureFileImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.CSISecretsStoreProviderAzureContainerName:  csiSecretsStoreProviderAzureImageReference,
		common.CSISecretsStoreDriverContainerName:         csiSecretsStoreDriverImageReference,
		common.AzureKMSProviderComponentName:              azureKMSProviderImageReference,
	}
	g.Expect(oneDotSixteenDotZero).To(Equal(expected))

	oneDotFifteenDotZero := getK8sVersionComponents("1.15.0", kubernetesImageBaseType, nil)
	if oneDotFifteenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.15"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.15.0",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.15.0",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.15.0",
		common.WindowsArtifactComponentName:               "v1.15.0/windowszip/v1.15.0-1int.zip",
		common.WindowsArtifactAzureStackComponentName:     "v1.15.0-azs/windowszip/v1.15.0-azs-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.DashboardMetricsScraperContainerName:       dashboardMetricsScraperImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.CoreDNSAddonName:                           getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
		common.CoreDNSAutoscalerName:                      clusterProportionalAutoscalerImageReference,
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
		common.AzureArcOnboardingAddonName:                azureArcOnboardingImageReference,
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.DNSSidecarComponentName:                    getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CSIProvisionerContainerName:                csiProvisionerImageReference,
		common.CSIAttacherContainerName:                   csiAttacherImageReference,
		common.CSILivenessProbeContainerName:              csiLivenessProbeImageReference,
		common.CSINodeDriverRegistrarContainerName:        csiNodeDriverRegistrarImageReference,
		common.CSIAzureDiskContainerName:                  csiAzureDiskImageReference,
		common.CSIAzureFileContainerName:                  csiAzureFileImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
		common.AzureKMSProviderComponentName:              azureKMSProviderImageReference,
	}
	g.Expect(oneDotFifteenDotZero).To(Equal(expected))

	oneDotFourteenDotZero := getK8sVersionComponents("1.14.0", kubernetesImageBaseType, nil)
	if oneDotFourteenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.14"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.14.0",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.14.0",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.14.0",
		common.WindowsArtifactComponentName:               "v1.14.0/windowszip/v1.14.0-1int.zip",
		common.WindowsArtifactAzureStackComponentName:     "v1.14.0-azs/windowszip/v1.14.0-azs-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.DashboardMetricsScraperContainerName:       dashboardMetricsScraperImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.CoreDNSAddonName:                           getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
		common.CoreDNSAutoscalerName:                      clusterProportionalAutoscalerImageReference,
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.DNSSidecarComponentName:                    getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CSIProvisionerContainerName:                csiProvisionerImageReference,
		common.CSIAttacherContainerName:                   csiAttacherImageReference,
		common.CSILivenessProbeContainerName:              csiLivenessProbeImageReference,
		common.CSINodeDriverRegistrarContainerName:        csiNodeDriverRegistrarImageReference,
		common.CSIAzureDiskContainerName:                  csiAzureDiskImageReference,
		common.CSIAzureFileContainerName:                  csiAzureFileImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
		common.AzureKMSProviderComponentName:              azureKMSProviderImageReference,
	}
	g.Expect(oneDotFourteenDotZero).To(Equal(expected))

	oneDotThirteenDotZero := getK8sVersionComponents("1.13.0", kubernetesImageBaseType, nil)
	if oneDotThirteenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.13"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.13.0",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.13.0",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.13.0",
		common.WindowsArtifactComponentName:               "v1.13.0/windowszip/v1.13.0-1int.zip",
		common.WindowsArtifactAzureStackComponentName:     "v1.13.0-azs/windowszip/v1.13.0-azs-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.CoreDNSAddonName:                           getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
		common.CoreDNSAutoscalerName:                      clusterProportionalAutoscalerImageReference,
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.DNSSidecarComponentName:                    getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CSIProvisionerContainerName:                csiProvisionerImageReference,
		common.CSIAttacherContainerName:                   csiAttacherImageReference,
		common.CSILivenessProbeContainerName:              csiLivenessProbeImageReference,
		common.CSINodeDriverRegistrarContainerName:        csiNodeDriverRegistrarImageReference,
		common.CSIAzureDiskContainerName:                  csiAzureDiskImageReference,
		common.CSIAzureFileContainerName:                  csiAzureFileImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
		common.AzureKMSProviderComponentName:              azureKMSProviderImageReference,
	}
	g.Expect(oneDotThirteenDotZero).To(Equal(expected))

	oneDotTwelveDotZero := getK8sVersionComponents("1.12.0", kubernetesImageBaseType, nil)
	if oneDotTwelveDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.12"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.12.0",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.12.0",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.12.0",
		common.WindowsArtifactComponentName:               "v1.12.0-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.CoreDNSAddonName:                           getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
		common.CoreDNSAutoscalerName:                      clusterProportionalAutoscalerImageReference,
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.DNSSidecarComponentName:                    getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
	}
	g.Expect(oneDotTwelveDotZero).To(Equal(expected))

	oneDotElevenDotZero := getK8sVersionComponents("1.11.0-alpha.1", kubernetesImageBaseType, nil)
	if oneDotElevenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.11"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.11.0-alpha.1",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.11.0-alpha.1",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.11.0-alpha.1",
		common.WindowsArtifactComponentName:               "v1.11.0-alpha.1-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.DNSSidecarComponentName:                    getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
	}
	g.Expect(oneDotElevenDotZero).To(Equal(expected))

	oneDotTenDotZero := getK8sVersionComponents("1.10.0", kubernetesImageBaseType, nil)
	if oneDotTenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.10"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.10.0",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.10.0",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.10.0",
		common.WindowsArtifactComponentName:               "v1.10.0-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       k8sComponent[common.ReschedulerAddonName],
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.NVIDIADevicePluginAddonName:                nvidiaDevicePluginImageReference,
		common.DNSSidecarComponentName:                    k8sComponent[common.DNSSidecarComponentName],
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
	}
	g.Expect(oneDotTenDotZero).To(Equal(expected))

	oneDotNineDotThree := getK8sVersionComponents("1.9.3", kubernetesImageBaseType, nil)
	if oneDotNineDotThree == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.9"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.9.3",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.9.3",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.9.3",
		common.WindowsArtifactComponentName:               "v1.9.3-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       k8sComponent[common.ReschedulerAddonName],
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.DNSSidecarComponentName:                    k8sComponent[common.DNSSidecarComponentName],
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
	}
	g.Expect(oneDotNineDotThree).To(Equal(expected))

	oneDotEightDotEight := getK8sVersionComponents("1.8.8", kubernetesImageBaseType, nil)
	if oneDotEightDotEight == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.8"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.8.8",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.8.8",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.8.8",
		common.WindowsArtifactComponentName:               "v1.8.8-1int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.KubeDNSAddonName:                           k8sComponent[common.KubeDNSAddonName],
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       k8sComponent[common.DNSMasqComponentName],
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       k8sComponent[common.ReschedulerAddonName],
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
	}
	g.Expect(oneDotEightDotEight).To(Equal(expected))

	oneDotSevenDotZero := getK8sVersionComponents("1.7.13", kubernetesImageBaseType, nil)
	if oneDotSevenDotZero == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.7"]
	expected = map[string]string{
		common.Hyperkube:                 "hyperkube-amd64:v1.7.13",
		common.KubeProxyAddonName:        "hyperkube-amd64:v1.7.13",
		common.DashboardAddonName:        k8sComponent["dashboard"],
		common.ExecHealthZComponentName:  getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:    k8sComponent[common.MetricsServerAddonName],
		common.KubeDNSAddonName:          k8sComponent[common.KubeDNSAddonName],
		common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:      k8sComponent[common.DNSMasqComponentName],
		common.PauseComponentName:        pauseImageReference,
		common.TillerAddonName:           tillerImageReference,
		common.ReschedulerAddonName:      k8sComponent[common.ReschedulerAddonName],
		common.ACIConnectorAddonName:     virtualKubeletImageReference,
		"nodestatusfreq":                 DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                    DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                    DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                  strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                   strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":              strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":           strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                 strconv.Itoa(DefaultKubernetesGCLowThreshold),
	}
	g.Expect(oneDotSevenDotZero).To(Equal(expected))

	override := getK8sVersionComponents("1.9.3", kubernetesImageBaseType, map[string]string{common.WindowsArtifactComponentName: "v1.9.3-2int.zip"})
	if override == nil {
		t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
	}
	k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.9"]
	expected = map[string]string{
		common.Hyperkube:                                  "hyperkube-amd64:v1.9.3",
		common.KubeProxyAddonName:                         "hyperkube-amd64:v1.9.3",
		common.CloudControllerManagerComponentName:        "cloud-controller-manager-amd64:v1.9.3",
		common.WindowsArtifactComponentName:               "v1.9.3-2int.zip",
		common.DashboardAddonName:                         dashboardImageReference,
		common.ExecHealthZComponentName:                   getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
		common.AddonResizerComponentName:                  k8sComponent[common.AddonResizerComponentName],
		common.MetricsServerAddonName:                     k8sComponent[common.MetricsServerAddonName],
		common.KubeDNSAddonName:                           getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
		common.AddonManagerComponentName:                  k8sComponent[common.AddonManagerComponentName],
		common.DNSMasqComponentName:                       getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
		common.PauseComponentName:                         pauseImageReference,
		common.TillerAddonName:                            tillerImageReference,
		common.ReschedulerAddonName:                       k8sComponent[common.ReschedulerAddonName],
		common.ACIConnectorAddonName:                      virtualKubeletImageReference,
		common.ClusterAutoscalerAddonName:                 k8sComponent[common.ClusterAutoscalerAddonName],
		common.DNSSidecarComponentName:                    k8sComponent[common.DNSSidecarComponentName],
		common.BlobfuseFlexVolumeAddonName:                blobfuseFlexVolumeImageReference,
		common.SMBFlexVolumeAddonName:                     smbFlexVolumeImageReference,
		common.KeyVaultFlexVolumeAddonName:                keyvaultFlexVolumeImageReference,
		common.IPMASQAgentAddonName:                       getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
		common.AzureNetworkPolicyAddonName:                azureNPMContainerImageReference,
		common.CalicoTyphaComponentName:                   calicoTyphaImageReference,
		common.CalicoCNIComponentName:                     calicoCNIImageReference,
		common.CalicoNodeComponentName:                    calicoNodeImageReference,
		common.CalicoPod2DaemonComponentName:              calicoPod2DaemonImageReference,
		common.CalicoClusterAutoscalerComponentName:       calicoClusterProportionalAutoscalerImageReference,
		common.CiliumAgentContainerName:                   ciliumAgentImageReference,
		common.CiliumCleanStateContainerName:              ciliumCleanStateImageReference,
		common.CiliumOperatorContainerName:                ciliumOperatorImageReference,
		common.CiliumEtcdOperatorContainerName:            ciliumEtcdOperatorImageReference,
		common.AntreaControllerContainerName:              antreaControllerImageReference,
		common.AntreaAgentContainerName:                   antreaAgentImageReference,
		common.AntreaOVSContainerName:                     antreaOVSImageReference,
		"antrea" + common.AntreaInstallCNIContainerName:   antreaInstallCNIImageReference,
		common.NMIContainerName:                           aadPodIdentityNMIImageReference,
		common.MICContainerName:                           aadPodIdentityMICImageReference,
		common.AzurePolicyAddonName:                       azurePolicyImageReference,
		common.GatekeeperContainerName:                    gatekeeperImageReference,
		common.NodeProblemDetectorAddonName:               nodeProblemDetectorImageReference,
		common.KubeFlannelContainerName:                   kubeFlannelImageReference,
		"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
		common.KubeRBACProxyContainerName:                 KubeRBACProxyImageReference,
		common.ScheduledMaintenanceManagerContainerName:   ScheduledMaintenanceManagerImageReference,
		"nodestatusfreq":                                  DefaultKubernetesNodeStatusUpdateFrequency,
		"nodegraceperiod":                                 DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
		"podeviction":                                     DefaultKubernetesCtrlMgrPodEvictionTimeout,
		"routeperiod":                                     DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
		"backoffretries":                                  strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
		"backoffjitter":                                   strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
		"backoffduration":                                 strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
		"backoffexponent":                                 strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
		"ratelimitqps":                                    strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
		"ratelimitqpswrite":                               strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
		"ratelimitbucket":                                 strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
		"ratelimitbucketwrite":                            strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
		"gchighthreshold":                                 strconv.Itoa(DefaultKubernetesGCHighThreshold),
		"gclowthreshold":                                  strconv.Itoa(DefaultKubernetesGCLowThreshold),
	}
	g.Expect(override).To(Equal(expected))

	unknown := getK8sVersionComponents("1.0.0", kubernetesImageBaseType, nil)
	if unknown != nil {
		t.Fatalf("getK8sVersionComponents() should return nil for unknown k8s version")
	}
}
